import Vue from "vue";
//引入vue
import VueRouter from "vue-router";
//引入路由
import HomeView from "../views/HomeView.vue";
//引入了home页面（组件
// 引入页面 有两种方法 一种是在这里头部引 一种是 在加载到component的时候才引入

Vue.use(VueRouter);
//vue使用路由

const routes = [
  {
    path: "/aaa",
    name: "home",
    component: HomeView,
    // component这个单词是组件的意思
  },
  //规定了地址栏的路径是/的时候加载 home页面

  {
    path: "/about",
    name: "about",
    component: () => import("../views/AboutView.vue"),
  },
  //地址栏是/about的时候就加载about页面
  {
    path: "/page",
    name: "page",
    component: () => import("../views/Page.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
